// src/services/adjust.js

import Adjust from '@adjustcom/adjust-web-sdk';

export const initAdjust = () => {
  // 初始化Adjust
  Adjust.initSdk({
    appToken: '40j13bgpz9mo',
    environment: process.env.NODE_ENV === 'production' ? 'production' : 'sandbox',
    // 是否默认请求归因
    defaultAttribution: true,
  });
};

// 追踪事件
export const trackAdjustPurchaseEvent = (price) => {
  Adjust.trackEvent({
    eventToken: '2lb83v',
    revenue: price,
    currency: 'USD', // 货币单位
  });
};